from django.conf import settings
from django.urls import path
from django.views.generic import ListView

from myblog.models import Article
from . import views

app_name = 'myblog'
urlpatterns = [

    path('', views.IndexView.as_view(), name = 'index'),
    path('detail/<pk>/', views.ArticleDetailView.as_view(), name='detail'),
    path('comment/<pk>/', views.CommentView.as_view(), name ='comment'),
    path('search', views.SearchView.as_view(), name='search'),
    path('archive/<year>/<month>', views.ArchiveView.as_view(), name='archive'),
    path('category/<pk>', views.CategoryView.as_view(), name='category'),
    path('tag/<pk>', views.TagView.as_view(), name='tag'),
    path('middletest', views.middletest, name='middletest'),
]
# path('', ListView.as_view(
#     model=Article,
#     template_name='myblog/index.html',
#     paginate_by=settings.PER_PAGE), name='index')
# urlpatterns = [
#     path('', views.index, name = 'index'),
#     path('detail/<pk>/', views.detail, name='detail'),
#     path('comment/<pk>/', views.comment, name ='comment'),
#     path('search', views.search, name='search'),
#     path('archive/<year>/<month>', views.archive, name='archive'),
#     path('category/<pk>', views.category, name='category'),
#     path('tag/<pk>', views.tag, name='tag'),
# ]